import request from '@/config/axios'

// 意见反馈分类 VO
export interface FeedbackCategoryVO {
  id: number | string // 唯一编号
  parentId: number | string // 父级编号
  name: string // 分类名称
  sort: number // 分类排序
  status: number // 开启状态
}

// 意见反馈分类 API
export const FeedbackCategoryApi = {
  // 查询意见反馈分类分页
  getFeedbackCategoryPage: async (params: any) => {
    return await request.get({ url: `/cms/feedback-category/page`, params })
  },

  // 查询意见反馈分类列表
  getFeedbackCategoryList: async () => {
    return await request.get({ url: `/cms/feedback-category/list` })
  },

  // 查询意见反馈分类详情
  getFeedbackCategory: async (id: number | string) => {
    return await request.get({ url: `/cms/feedback-category/get?id=` + id })
  },

  // 新增意见反馈分类
  createFeedbackCategory: async (data: FeedbackCategoryVO) => {
    return await request.post({ url: `/cms/feedback-category/create`, data })
  },

  // 修改意见反馈分类
  updateFeedbackCategory: async (data: FeedbackCategoryVO) => {
    return await request.post({ url: `/cms/feedback-category/update`, data })
  },

  // 删除意见反馈分类
  deleteFeedbackCategory: async (id: number | string) => {
    return await request.get({ url: `/cms/feedback-category/delete?id=` + id })
  },

  // 导出意见反馈分类 Excel
  exportFeedbackCategory: async (params) => {
    return await request.download({ url: `/cms/feedback-category/export-excel`, params })
  }
}
